package pack0625;

import java.util.Random;

public class Computer {
    public String name;
    public int score;
    String type;
    public Computer(String name){
        this.name = name;
        this.score = 0;
    }

    public int showHand(){
        System.out.println("电脑");
        Random r = new Random();
        int n = r.nextInt(3)+1;
        if ((n==1)){
            type = "石头";
        }else if (n==2){
            type = "剪刀";
        }else {
            type = "布";
        }
                return n;
    }
        public void addScore(){
            this.score+=1;
        }
        public int getScore(){
            return score;
        }
        public String getName(){
            return name;
        }

}
